# print(1 + 2 - 3)
# print(1 + 2 * 3)
# print(1 + 2 / 3)
# 代码的美观重要吗
# 所处的世界是看脸的世界


# C /Java 中整数除以整数还是整数!并且会把小数部分删除
# print(1 + 2 / 3)
# 1.6666666666666665
# 编程ing 一般没有四舍五入
# python 中浮点数
# 浮点数 IEEE754  这套规则下，在内存ing表示浮点数会存在微笑的误差

# 1 + 2 / 3称为表达式
# 1 2 3这样的数字称为字面常量
# 给定四个分数, 67.5, 89.0, 12.9, 32.2 , 编写代码, 求这四个分数的平均数.
# print((67.5 + 89.0 + 12.9 + 32.2) / 4)
# # 求方差
# avg = (67.5 + 89.0 + 12.9 + 32.2) / 4
# total = (67.5 - avg)**2 + (89.0 -avg)**2 + (12.9- avg)**2 + (32.2 -avg)**2
#
# print(total)


# 变量的类型
# a = 10
# print(type(a))
#
# a= 0.5
# print(type(a))
#
# a= 'hello'
# print(type(a))
# print(len(a))
#
# b= 'world'
# print(a+b)


# 布尔类型
# a = True
# print(type(a))
#
# b=False
# print(type(b))


# a="hello world"
# print(type(a))
# a=10
# print(type(a))


# 输入
# num = 0
# num = input("Enter a number: ")
# print(f'The number is {num}')


# a= input("Enter a number")
# b= input("Enter another number")
# c=input("Enter another number")
# d=input("Enter another number")
#
# a=float(a)
# b=float(b)
# c=float(c)
# d=float(d)
# print(f"a+b+c+d = {a+b+c+d}")


# print(7 % 2)  #1  求余数
# print(4**2)   #16
# print(7//2)   #3
# print(-7//2)  #-4

#
# a=10
# b=20
#
# print(a<b)
# print(a>=b)
# print(a<=b)
# print(a==b)
# print(a!=b)


# a = "hello world"
# b = "difhnjkdflg"
# print(a < b)
# print(a >= b)
# print(a <= b)
# print(a == b)
# print(a != b)

#
# print(0.1 + 0.2 == 0.3)
#
#
# a=0.1 +0.2
# c=0.3
# print(-0.00001 < (a-c) < 0.00001)
#
#
# a=10
# b=20
# c=30
# print(a<b and b<c)

# a=b=10
# a,b=10,20

# a=10
# b=20
#
# temp = a
# a=b
# b=temp

#
# num = 1
# while num <10:
#     print(num)
#     num = num + 1


# sum = 0
# num = 1
# while num <=100:
#     sum = sum + num
#     num+=1
# print(sum)


# result = 1
# n = 1
# while n <= 5:
#     result = result * n
#     n+=1
# print(result)


# 函数
# def calSum(beh,end):
#     sum = 0
#     for i in range(beh,end+1):
#         sum = sum + i
#     print(sum)
#
# calSum(1,100)


# def Is_odd(num):
#     if num%2==0:
#         return True
#     else:
#         return False
#
# resuly = Is_odd(10)
# print(resuly)


# def getPoint():
#     x=10
#     y=20
#     return x,y
#
# a,b=getPoint()
# print(a)
# print(b)


# def getPoint():
#     x=10
#     y=20
#     return x,y
#
# _,b=getPoint()


# 变量的作用域
# def getPoint():
#     x=20
#     y=30
#     return x,y
# getPoint()
# print(x)
# print(y)



# x=20
# def test():
#     x=10
#     print(f"函数内部{x}")
#
# test()

#
# x=20
# def test():
#     x=10
#     print(f"函数内部{x}")
#
# test()
#
# print(f"函数外部{x}")


# for i in range(1,11):
#     print(f"函数内部{i}")
# print(f"函数外部{i}")



# def test():
#     print('hello world')
#     print('hello world')
#     print('hello world')
#
# print("1111")
# test()
# print("2222")
# test()
# print("3333")



# def isOdd(num):
#     if num % 2 ==0:
#         return True
#     else:
#         return False
# resource = isOdd(10)
# print(resource)
# print(isOdd(10))


# def test():
#     print('hello world')
#     print('hello world')
#     print('hello world')
#     print('hello world')
#
# test()


# def a():
#     print('hello world')
#
#
# def b():
#     print("2")
#     a()
#
# def c():
#     print('3')
#     b()
#
# c()
#



#
# num1 = 10
# num2 = 20
# num3 = 30
#
# print(num1)


# alist = []
#
# # alist = list()
#
# print(type(alist))

# alist = [1,2,3,4,5,6,7,8,9]
# alist = [1,"sgdsgd",3.14]
# print(alist)

#
# alist = [1,2,3,4,5,6,7,8]
#
# print(alist[2]) #3


# alist = [1,2,3,4,5,6,7,8]
# alist[2] = 100
# print(alist)

#
# alist = [1,2,3,4,5,6,7,8]
# print(len(alist))

# alist = [1,2,3,4,5,6,7,8]
# print(alist[3])   #4
# print(alist[-1])  #8
#


# 切片操作
# alist = [1,2,3,4,5,6,7,8,9]
# print(alist[1:3])  #左开右闭

# alist = [1,2,3,4,5,6,7,8]
# print(alist[1:])
# print(alist[-1:])
# print(alist[:])

alist = [1,2,3,4,5,6,7,8]
print(alist[::1])
print(alist[::2])
print(alist[::-1])